package com.wrapper;

public class WrapperInteger {
    public static void main(String[] args) {
        Integer i = new Integer(1);
        Integer j = new Integer(1);
        System.out.println(i == j);

        //主要对范围是 -128 ～ 127 就直接返回
        Integer m = 1; //底层 Integer.valueOf(1);
        Integer n = 1;
        System.out.println(m == n);//true

        //这里主要看范围是 -128 ～ 127 就是直接返回
        Integer x = 128;
        Integer y = 128;
        System.out.println(x == y);

        Integer i1 = new Integer(127);
        Integer i2 = new Integer(127);
        System.out.println(i1 == i2);

        Integer i3 = new Integer(128);
        Integer i4 = new Integer(128);
        System.out.println(i3 == i4);

        Integer i5 = 127;
        Integer i6 = 127;
        System.out.println(i5 == i6);//true

        Integer i7 = 128;
        Integer i8 = 128;
        System.out.println(i7 == i8);

        Integer i9 = 127;
        Integer i10 = new Integer(127);
        System.out.println(i9 == i10);

        Integer i11 = 127;
        int i12 = 127;
        System.out.println(i11 == i12);//true

        Integer i13 = 128;
        int i14 = 128;
        System.out.println(i13 == i14);//true


    }
}
